/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package listElement;

/**
 *
 * @author Boukry Omar
 */
public class TestCircularDoubleLinkedList {

    public static void main(String[] args) {
        CircularDoubleLinkedList<Personne> test1 = new CircularDoubleLinkedList();

        Personne omar = new Personne("Boukry", "Omar", 22);
        Personne aliona = new Personne("Efimovskaya", "Aliona", 20);
        Personne kamal = new Personne("Boukry", "Kamal", 29);
        Personne meriem = new Personne("Boukry", "Meriem", 27);
        Personne marc = new Personne("Boisban", "Marc", 24);
        Personne ion = new Personne("Gorodenco", "Ion", 24);
        Personne gicu = new Personne("Gorodenco", "Gicu", 26);

        //boolean add(E element)
        test1.add(omar);
        test1.add(aliona);
        test1.add(kamal);
        test1.add(ion);
        test1.add(marc);
        test1.add(meriem);
        test1.add(gicu);
        test1.add(omar);
        test1.add(ion);

        System.out.println("add(E element)\n"+test1.toString()+"\n");

        //E remove(int index)
        test1.remove(8);
        System.out.println("remove(int index)\n"+test1.toString()+"\n");

        //boolean remove(Object o)
        test1.remove(omar);
        System.out.println("remove(Object o)\n"+test1.toString()+"\n");

        //boolean add(int index, E element)
        test1.add(5,aliona);
        System.out.println("add(int index, E element)\n"+test1.toString()+"\n");

        //get(int index)
        System.out.println("get(int index)\n"+test1.get(3)+"\n");

        //E set(int index, E element)
        test1.set(7, marc);
        System.out.println("set(int index, E element)\n"+test1.toString()+"\n");

        //int size()
        System.out.println("size()\n"+test1.size()+"\n");

        //boolean contains(Object o)
        System.out.println("contains(Object o)\n"+(test1.contains(meriem) ? "meriem is in the CircularDoubleLinkedList" : "meriem is not in the CircularDoubleLinkedList")+"\n");

        //int indexOf(Object o)
        System.out.println("indexOf(Object o)\n"+test1.indexOf(kamal)+"\n");

        //List<E> subList(int fromIndex, int toIndex)
        System.out.println("subList(int fromIndex, int toIndex)\n"+test1.subList(2,test1.size()).toString()+"\n");
        System.out.println("subList(int fromIndex, int toIndex)\n"+test1.subList(30,20).toString()+"\n");

        //State of the list before calling the next element of the last
        System.out.println("add(E element)\n"+test1.toString()+"\n");

        //Calling the next of the last
        System.out.println("getNext(int index)\n"+test1.getNext(test1.size()-1).toString()+"\n");

        System.out.println("End of run");

    }
}
